const Router = require('koa-router')
const {auth} = require('../middleware/auth.middleware')
const {saveRolePermission, getRolePermissionById} = require('../controller/rolePermissionController')
const {RolePermissionValidator} = require('../middleware/role.middleware')

const rolePermissionRouter = new Router({prefix: '/role/permission'})

rolePermissionRouter.post('/save', auth, RolePermissionValidator, saveRolePermission)

rolePermissionRouter.get('/get/:id', auth, getRolePermissionById)

module.exports = rolePermissionRouter